<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="Hexo Theme Redefine">
    
    <meta name="author" content="liyuncong">
    <!-- preconnect -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>

    
    <!--- Seo Part-->
    
    <link rel="canonical" href="https://liyuncc.gitee.io/2024/01/03/data-representation/"/>
    <meta name="robots" content="index,follow">
    <meta name="googlebot" content="index,follow">
    <meta name="revisit-after" content="1 days">
    
        <meta name="description" content="一、进制转换（一）、进制表示 二进制：使用B标识，例如：3.14B 八进制：使用Q标识，例如：3.14Q 十进制：使用D标识，例如：3.14D 十六进制：使用H标识，例如：3.14H  （二）、整数部分转换整型有4中进制形式：  十进制：都是以0-9这九个数字组成，不能以0开头。 二进制： 由0和1两个数字组成。 八进制： 由0-7之间的数字组成，为了区分与其他进制的数字区别，开头都是以0开始。">
<meta property="og:type" content="article">
<meta property="og:title" content="数据的表示">
<meta property="og:url" content="https://liyuncc.gitee.io/2024/01/03/data-representation/index.html">
<meta property="og:site_name" content="YunCong&#39;s Blog">
<meta property="og:description" content="一、进制转换（一）、进制表示 二进制：使用B标识，例如：3.14B 八进制：使用Q标识，例如：3.14Q 十进制：使用D标识，例如：3.14D 十六进制：使用H标识，例如：3.14H  （二）、整数部分转换整型有4中进制形式：  十进制：都是以0-9这九个数字组成，不能以0开头。 二进制： 由0和1两个数字组成。 八进制： 由0-7之间的数字组成，为了区分与其他进制的数字区别，开头都是以0开始。">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://liyuncc.gitee.io/images/data-representation-floating-point.png">
<meta property="article:published_time" content="2024-01-03T15:59:18.000Z">
<meta property="article:modified_time" content="2024-01-10T02:53:47.666Z">
<meta property="article:author" content="liyuncong">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://liyuncc.gitee.io/images/data-representation-floating-point.png">
    
    
    <!--- Icon Part-->
    <link rel="icon" type="image/png" href="/images/redefine-favicon.svg" sizes="192x192">
    <link rel="apple-touch-icon" sizes="180x180" href="/images/redefine-favicon.svg">
    <meta name="theme-color" content="#A31F34">
    <link rel="shortcut icon" href="/images/redefine-favicon.svg">
    <!--- Page Info-->
    
    <title>
        
            数据的表示 -
        
        YunCong&#39;s Blog
    </title>

    
<link rel="stylesheet" href="/fonts/Chillax/chillax.css">


    
        <style>
    :root {
        --preloader-background-color: #fff;
        --preloader-text-color: #000;
    }

    @media (prefers-color-scheme: dark) {
        :root {
            --preloader-background-color: #202124;
            --preloader-text-color: #fff;
        }
    }

    @media (prefers-color-scheme: light) {
        :root {
            --preloader-background-color: #fff;
            --preloader-text-color: #000;
        }
    }

    @media (max-width: 600px) {
        .ml13 {
            font-size: 2.6rem !important; /* Adjust this value as needed */
        }
    }

    .preloader {
        display: flex;
        flex-direction: column;
        gap: 1rem; /* Tailwind 'gap-4' is 1rem */
        align-items: center;
        justify-content: center;
        position: fixed;
        padding: 12px;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100vw;
        height: 100vh; /* 'h-screen' is 100% of the viewport height */
        background-color: var(--preloader-background-color);
        z-index: 1100; /* 'z-[1100]' sets the z-index */
        transition: opacity 0.2s ease-in-out;
    }

    .ml13 {
        font-size: 3.2rem;
        /* text-transform: uppercase; */
        color: var(--preloader-text-color);
        letter-spacing: -1px;
        font-weight: 500;
        font-family: 'Chillax-Variable', sans-serif;
        text-align: center;
    }

    .ml13 .word {
        display: inline-flex;
        flex-wrap: wrap;
        white-space: nowrap;
    }

    .ml13 .letter {
        display: inline-block;
        line-height: 1em;
    }
</style>

<div class="preloader">
    
<script src="/js/libs/anime.min.js"></script>

    <h1 class="ml13">
        YunCong&#39;s Blog
    </h1>
    <script>
        var textWrapper = document.querySelector('.ml13');
        // Split text into words
        var words = textWrapper.textContent.trim().split(' ');

        // Clear the existing content
        textWrapper.innerHTML = '';

        // Wrap each word and its letters in spans
        words.forEach(function(word) {
            var wordSpan = document.createElement('span');
            wordSpan.classList.add('word');
            wordSpan.innerHTML = word.replace(/\S/g, "<span class='letter'>$&</span>");
            textWrapper.appendChild(wordSpan);
            textWrapper.appendChild(document.createTextNode(' ')); // Add space between words
        });


        anime.timeline({loop: true})
            .add({
                targets: '.ml13 .letter',
                translateY: [100,0],
                translateZ: 0,
                opacity: [0,1],
                easing: "easeOutExpo",
                duration: 1400,
                delay: (el, i) => 300 + 30 * i
            }).add({
            targets: '.ml13 .letter',
            translateY: [0,-100],
            opacity: [1,0],
            easing: "easeInExpo",
            duration: 1200,
            delay: (el, i) => 100 + 30 * i
        });

        let themeStatus = JSON.parse(localStorage.getItem('REDEFINE-THEME-STATUS'))?.isDark;

        // If the theme status is not found in local storage, check the preferred color scheme
        if (themeStatus === undefined || themeStatus === null) {
            if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
                themeStatus = 'dark';
            } else {
                themeStatus = 'light';
            }
        }

        // Now you can use the themeStatus variable in your code
        if (themeStatus) {
            document.documentElement.style.setProperty('--preloader-background-color', '#202124');
            document.documentElement.style.setProperty('--preloader-text-color', '#fff');
        } else {
            document.documentElement.style.setProperty('--preloader-background-color', '#fff');
            document.documentElement.style.setProperty('--preloader-text-color', '#000');
        }

        window.addEventListener('load', function () {
            hidePreloaderAfterTimeout(1000); // Hide after 1000 milliseconds once the window has loaded
        });

        // Backup failsafe: Hide preloader after a maximum of 5000 milliseconds, regardless of the window load event
        hidePreloaderAfterTimeout(5000);

        function hidePreloaderAfterTimeout(delay) {
            setTimeout(function () {
                var preloader = document.querySelector('.preloader');
                preloader.style.opacity = '0';
                setTimeout(function () {
                    preloader.style.display = 'none';
                }, 200);
            }, delay);
        }
    </script>
</div>
    

    
<link rel="stylesheet" href="/css/style.css">


    
        
<link rel="stylesheet" href="/assets/build/styles.css">

    

    
<link rel="stylesheet" href="/fonts/fonts.css">

    
<link rel="stylesheet" href="/fonts/Satoshi/satoshi.css">

    <!--- Font Part-->
    
    
    
    

    <!--- Inject Part-->
    
    <script id="hexo-configurations">
    window.config = {"hostname":"liyuncc.gitee.io","root":"/","language":"en"};
    window.theme = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true,"title_alignment":"left"},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":3,"number":false,"expand":true,"init_open":true},"copyright":{"enable":true,"default":"cc_by_nc_sa"},"lazyload":true,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/wallhaven-wqery6-light.webp","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://cn.vercount.one/js","enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"preloader":true,"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-wqery6-light.webp","dark":"/images/wallhaven-wqery6-dark.webp"},"title":"O ever youthful, O ever weeping!","subtitle":{"text":[],"hitokoto":{"enable":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":false,"links":{"github":null,"instagram":null,"zhihu":null,"twitter":null,"email":null},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.6.0","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"},"Archives":{"path":"/archives","icon":"fa-regular fa-archive"},"Enjoy":{"path":"/enjoy","icon":"fa-regular fa-heartbeat","submenus":{"Movie":"/movie","Image":"/masonry"}},"About":{"icon":"fa-regular fa-user","submenus":{"Me":"/about","Gitee":"https://gitee.com/liyuncc","Friends":"/friends"}}},"search":{"enable":false,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"links":{"Archives":{"path":"/archives","icon":"fa-regular fa-archive"},"Tags":{"path":"/tags","icon":"fa-regular fa-tags"}}},"article_date_format":"auto","categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2022/8/17 11:45:14"};
    window.lang_ago = {"second":"%s seconds ago","minute":"%s minutes ago","hour":"%s hours ago","day":"%s days ago","week":"%s weeks ago","month":"%s months ago","year":"%s years ago"};
    window.data = {"masonry":true};
  </script>
    
    <!--- Fontawesome Part-->
    
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">

    
<link rel="stylesheet" href="/fontawesome/brands.min.css">

    
<link rel="stylesheet" href="/fontawesome/solid.min.css">

    
<link rel="stylesheet" href="/fontawesome/regular.min.css">

    
    
    
    
<!-- hexo injector head_end start -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css">

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/hexo-math@4.0.0/dist/style.css">
<!-- hexo injector head_end end --><meta name="generator" content="Hexo 7.0.0"><link rel="alternate" href="/atom.xml" title="YunCong's Blog" type="application/atom+xml">
</head>


<body>
<div class="progress-bar-container">
    

    
        <span class="pjax-progress-bar"></span>
<!--        <span class="swup-progress-icon">-->
<!--            <i class="fa-solid fa-circle-notch fa-spin"></i>-->
<!--        </span>-->
    
</div>


<main class="page-container" id="swup">

    

    <div class="main-content-container">


        <div class="main-content-header">
            <header class="navbar-container">

    <div class="navbar-content">
        <div class="left">
            
            <a class="logo-title" href="/">
                
                YunCong&#39;s Blog
                
            </a>
        </div>

        <div class="right">
            <!-- PC -->
            <div class="desktop">
                <ul class="navbar-list">
                    
                        
                            

                            <li class="navbar-item">
                                <!-- Menu -->
                                <a class=""
                                   href="/"
                                        >
                                    <i class="fa-regular fa-house fa-fw"></i>
                                    HOME
                                    
                                </a>

                                <!-- Submenu -->
                                
                            </li>
                    
                        
                            

                            <li class="navbar-item">
                                <!-- Menu -->
                                <a class=""
                                   href="/archives"
                                        >
                                    <i class="fa-regular fa-archive fa-fw"></i>
                                    ARCHIVES
                                    
                                </a>

                                <!-- Submenu -->
                                
                            </li>
                    
                        
                            

                            <li class="navbar-item">
                                <!-- Menu -->
                                <a class="has-dropdown"
                                   href="#"
                                        onClick=&#34;return false;&#34;>
                                    <i class="fa-regular fa-heartbeat fa-fw"></i>
                                    ENJOY
                                    <i class="fa-solid fa-chevron-down fa-fw"></i>
                                </a>

                                <!-- Submenu -->
                                
                                    <ul class="sub-menu">
                                        
                                            <li>
                                                <a href="/movie">
                                                    MOVIE
                                                </a>
                                            </li>
                                        
                                            <li>
                                                <a href="/masonry">
                                                    IMAGE
                                                </a>
                                            </li>
                                        
                                    </ul>
                                
                            </li>
                    
                        
                            

                            <li class="navbar-item">
                                <!-- Menu -->
                                <a class="has-dropdown"
                                   href="#"
                                        onClick=&#34;return false;&#34;>
                                    <i class="fa-regular fa-user fa-fw"></i>
                                    ABOUT
                                    <i class="fa-solid fa-chevron-down fa-fw"></i>
                                </a>

                                <!-- Submenu -->
                                
                                    <ul class="sub-menu">
                                        
                                            <li>
                                                <a href="/about">
                                                    ME
                                                </a>
                                            </li>
                                        
                                            <li>
                                                <a target="_blank" rel="noopener" href="https://gitee.com/liyuncc">
                                                    GITEE
                                                </a>
                                            </li>
                                        
                                            <li>
                                                <a href="/friends">
                                                    FRIENDS
                                                </a>
                                            </li>
                                        
                                    </ul>
                                
                            </li>
                    
                    
                </ul>
            </div>
            <!-- Mobile -->
            <div class="mobile">
                
                <div class="icon-item navbar-bar">
                    <div class="navbar-bar-middle"></div>
                </div>
            </div>
        </div>
    </div>

    <!-- Mobile drawer -->
    <div class="navbar-drawer h-screen w-full absolute top-0 left-0 bg-background-color flex flex-col justify-between">
        <ul class="drawer-navbar-list flex flex-col px-4 justify-center items-start">
            
                
                    

                    <li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
                        
                        <a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
                           href="/"
                        >
                            <span>
                                HOME
                            </span>
                            
                                <i class="fa-regular fa-house fa-sm fa-fw"></i>
                            
                        </a>
                        

                        
                    </li>
            
                
                    

                    <li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
                        
                        <a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
                           href="/archives"
                        >
                            <span>
                                ARCHIVES
                            </span>
                            
                                <i class="fa-regular fa-archive fa-sm fa-fw"></i>
                            
                        </a>
                        

                        
                    </li>
            
                
                    

                    <li class="drawer-navbar-item-sub text-base my-1.5 flex flex-col w-full">
                        
                        <div class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary cursor-pointer text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
                             navbar-data-toggle="submenu-Enjoy"
                        >
                            <span>
                                ENJOY
                            </span>
                            
                                <i class="fa-solid fa-chevron-right fa-sm fa-fw transition-all"></i>
                            
                        </div>
                        

                        
                            <div class="flex-col items-start px-2 py-2 hidden" data-target="submenu-Enjoy">
                                
                                    <div class="drawer-navbar-item text-base flex flex-col justify-center items-start hover:underline active:underline hover:underline-offset-1 rounded-3xl">
                                        <a class=" text-third-text-color text-xl"
                                           href="/movie">MOVIE</a>
                                    </div>
                                
                                    <div class="drawer-navbar-item text-base flex flex-col justify-center items-start hover:underline active:underline hover:underline-offset-1 rounded-3xl">
                                        <a class=" text-third-text-color text-xl"
                                           href="/masonry">IMAGE</a>
                                    </div>
                                
                            </div>
                        
                    </li>
            
                
                    

                    <li class="drawer-navbar-item-sub text-base my-1.5 flex flex-col w-full">
                        
                        <div class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary cursor-pointer text-2xl font-semibold group border-b border-border-color hover:border-primary w-full "
                             navbar-data-toggle="submenu-About"
                        >
                            <span>
                                ABOUT
                            </span>
                            
                                <i class="fa-solid fa-chevron-right fa-sm fa-fw transition-all"></i>
                            
                        </div>
                        

                        
                            <div class="flex-col items-start px-2 py-2 hidden" data-target="submenu-About">
                                
                                    <div class="drawer-navbar-item text-base flex flex-col justify-center items-start hover:underline active:underline hover:underline-offset-1 rounded-3xl">
                                        <a class=" text-third-text-color text-xl"
                                           href="/about">ME</a>
                                    </div>
                                
                                    <div class="drawer-navbar-item text-base flex flex-col justify-center items-start hover:underline active:underline hover:underline-offset-1 rounded-3xl">
                                        <a class=" text-third-text-color text-xl"
                                           target="_blank" rel="noopener" href="https://gitee.com/liyuncc">GITEE</a>
                                    </div>
                                
                                    <div class="drawer-navbar-item text-base flex flex-col justify-center items-start hover:underline active:underline hover:underline-offset-1 rounded-3xl">
                                        <a class=" text-third-text-color text-xl"
                                           href="/friends">FRIENDS</a>
                                    </div>
                                
                            </div>
                        
                    </li>
            
        </ul>

        <div class="statistics flex justify-around my-2.5">
    <a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/tags">
        <div class="number text-2xl sm:text-xl text-second-text-color font-semibold">3</div>
        <div class="label text-third-text-color text-sm">Tags</div>
    </a>
    <a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/categories">
        <div class="number text-2xl sm:text-xl text-second-text-color font-semibold">0</div>
        <div class="label text-third-text-color text-sm">Categories</div>
    </a>
    <a class="item tag-count-item flex flex-col justify-center items-center w-20" href="/archives">
        <div class="number text-2xl sm:text-xl text-second-text-color font-semibold">5</div>
        <div class="label text-third-text-color text-sm">Posts</div>
    </a>
</div>
    </div>

    <div class="window-mask"></div>

</header>


        </div>

        <div class="main-content-body">

            

            <div class="main-content">

                
                    <div class="post-page-container flex relative justify-between box-border w-full h-full">
    <div class="article-content-container">

        <div class="article-title relative w-full">
            
                <div class="w-full flex items-center pt-6 justify-start">
                    <h1 class="article-title-regular text-second-text-color text-4xl md:text-6xl font-bold px-2 sm:px-6 md:px-8 py-3">数据的表示</h1>
                </div>
            
            </div>

        
            <div class="article-header flex flex-row gap-2 items-center px-2 sm:px-6 md:px-8">
                <div class="avatar w-[46px] h-[46px] flex-shrink-0 rounded-medium border border-border-color p-[1px]">
                    <img src="/images/redefine-avatar.svg">
                </div>
                <div class="info flex flex-col justify-between">
                    <div class="author flex items-center">
                        <span class="name text-default-text-color text-lg font-semibold">liyuncong</span>
                        
                            <span class="author-label ml-1.5 text-xs px-2 py-0.5 rounded-small text-third-text-color border border-shadow-color-1">Lv1</span>
                        
                    </div>
                    <div class="meta-info">
                        <div class="article-meta-info">
    <span class="article-date article-meta-item">
        <i class="fa-regular fa-pen-fancy"></i>&nbsp;
        <span class="desktop">2024-01-03 23:59:18</span>
        <span class="mobile">2024-01-03 23:59:18</span>
        <span class="hover-info">Created</span>
    </span>
    
        <span class="article-date article-meta-item">
            <i class="fa-regular fa-wrench"></i>&nbsp;
            <span class="desktop">2024-01-10 10:53:47</span>
            <span class="mobile">2024-01-10 10:53:47</span>
            <span class="hover-info">Updated</span>
        </span>
    

    
    

    
    
    
    
        <span class="article-pv article-meta-item">
            <i class="fa-regular fa-eye"></i>&nbsp;<span id="busuanzi_value_page_pv"></span>
        </span>
    
</div>

                    </div>
                </div>
            </div>
        

        


        <div class="article-content markdown-body px-2 sm:px-6 md:px-8 pb-8">
            <h2 id="一、进制转换"><a href="#一、进制转换" class="headerlink" title="一、进制转换"></a>一、进制转换</h2><h3 id="（一）、进制表示"><a href="#（一）、进制表示" class="headerlink" title="（一）、进制表示"></a>（一）、进制表示</h3><ol>
<li>二进制：使用B标识，例如：3.14B</li>
<li>八进制：使用Q标识，例如：3.14Q</li>
<li>十进制：使用D标识，例如：3.14D</li>
<li>十六进制：使用H标识，例如：3.14H</li>
</ol>
<h3 id="（二）、整数部分转换"><a href="#（二）、整数部分转换" class="headerlink" title="（二）、整数部分转换"></a>（二）、整数部分转换</h3><p>整型有4中进制形式：</p>
<ol>
<li><strong>十进制：都是以0-9这九个数字组成，不能以0开头。</strong></li>
<li><strong>二进制： 由0和1两个数字组成。</strong></li>
<li><strong>八进制： 由0-7之间的数字组成，为了区分与其他进制的数字区别，开头都是以0开始。</strong></li>
<li><strong>十六进制：由0-9和A-F(大小均可)组成。为了区分于其他数字的区别，开头都是以0x开始。</strong></li>
</ol>
<table>
<thead>
<tr>
<th>二进制</th>
<th>八进制</th>
<th>十进制</th>
<th>十六进制</th>
</tr>
</thead>
<tbody><tr>
<td>0000</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>0001</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>0010</td>
<td>2</td>
<td>2</td>
<td>2</td>
</tr>
<tr>
<td>0011</td>
<td>3</td>
<td>3</td>
<td>3</td>
</tr>
<tr>
<td>0100</td>
<td>4</td>
<td>4</td>
<td>4</td>
</tr>
<tr>
<td>0101</td>
<td>5</td>
<td>5</td>
<td>5</td>
</tr>
<tr>
<td>0110</td>
<td>6</td>
<td>6</td>
<td>6</td>
</tr>
<tr>
<td>0111</td>
<td>7</td>
<td>7</td>
<td>7</td>
</tr>
<tr>
<td>1000</td>
<td>10</td>
<td>8</td>
<td>8</td>
</tr>
<tr>
<td>1001</td>
<td>11</td>
<td>9</td>
<td>9</td>
</tr>
<tr>
<td>1010</td>
<td>12</td>
<td>10</td>
<td>A</td>
</tr>
<tr>
<td>1011</td>
<td>13</td>
<td>11</td>
<td>B</td>
</tr>
<tr>
<td>1100</td>
<td>14</td>
<td>12</td>
<td>C</td>
</tr>
<tr>
<td>1101</td>
<td>15</td>
<td>13</td>
<td>D</td>
</tr>
<tr>
<td>1110</td>
<td>16</td>
<td>14</td>
<td>E</td>
</tr>
<tr>
<td>1111</td>
<td>17</td>
<td>15</td>
<td>F</td>
</tr>
</tbody></table>
<h4 id="1、十进制转二进制"><a href="#1、十进制转二进制" class="headerlink" title="1、十进制转二进制"></a>1、十进制转二进制</h4><ol>
<li>十进制转二进制的转换原理：除以2，反向取余，知道商数为0终止；</li>
<li>具体做法：<blockquote>
<p>将某个十进制数除2得到的整数部分保留，作为第二次除2时的被除数，得到的余数依次记下，重复上述步骤，直到整数部分为0就结束，将所有得到的余数最终逆序输出，则为该十进制对应的二进制数。</p>
</blockquote>
</li>
</ol>
<p>例如：9（十进制）&rarr; 1001（二进制）</p>
<div class="highlight-container" data-rel="Plaintext"><figure class="iseeu highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">2  |__9__</span><br><span class="line">2     |__4__ ----1</span><br><span class="line">2        |__2__ ----0</span><br><span class="line">2           |__1__ ----0</span><br><span class="line">2              |__0__ ----1</span><br></pre></td></tr></table></figure></div>

<h4 id="2、十进制转八进制"><a href="#2、十进制转八进制" class="headerlink" title="2、十进制转八进制"></a>2、十进制转八进制</h4><ol>
<li>十进制转八进制的转换原理：除以8，反向取余，直到商数为0终止；</li>
<li>具体做法：参考十进制转二进制；</li>
</ol>
<p>例如：666 &rarr; 1231</p>
<div class="highlight-container" data-rel="Plaintext"><figure class="iseeu highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">8  |__666___</span><br><span class="line">8     |__83__ ----2</span><br><span class="line">8        |__10__ ----3</span><br><span class="line">8           |__1__ ----2</span><br><span class="line">8              |__0__ ----1        </span><br></pre></td></tr></table></figure></div>

<h4 id="3、十进制转十六进制"><a href="#3、十进制转十六进制" class="headerlink" title="3、十进制转十六进制"></a>3、十进制转十六进制</h4><ol>
<li>转换原理：除以16，反向取余，直到商数为0终止；</li>
<li>具体做法：参考十进制转二进制；</li>
</ol>
<p>例如：666 &rarr; 29A</p>
<div class="highlight-container" data-rel="Plaintext"><figure class="iseeu highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">16 |__666__</span><br><span class="line">16    |__41__ ----10</span><br><span class="line">16       |__2__ ----9</span><br><span class="line">16          |__0__ ----2</span><br></pre></td></tr></table></figure></div>

<h4 id="4、二进制、八进制、十六进制转换成十进制"><a href="#4、二进制、八进制、十六进制转换成十进制" class="headerlink" title="4、二进制、八进制、十六进制转换成十进制"></a>4、二进制、八进制、十六进制转换成十进制</h4><ol>
<li>原理：按位乘以位权（小数点左侧从0开始），总数相加；</li>
</ol>
<p>例如：</p>
<p>100101B &rarr; 37D</p>
<div class="highlight-container" data-rel="Plaintext"><figure class="iseeu highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">1 * 2^5 + 0 + 0 + 1 * 2^2 + 0 + 1 * 2^0 = 37</span><br></pre></td></tr></table></figure></div>

<p>213Q &rarr; 139D</p>
<div class="highlight-container" data-rel="Plaintext"><figure class="iseeu highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">2 * 8^2 + 1 * 8^1 + 3 * 8^0 = 128 + 8 + 3 = 139</span><br></pre></td></tr></table></figure></div>

<p>12H &rarr; 18D</p>
<div class="highlight-container" data-rel="Plaintext"><figure class="iseeu highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">1 * 16^1 + 2 * 16^0 = 18</span><br></pre></td></tr></table></figure></div>

<h3 id="（三）、小数部分转换"><a href="#（三）、小数部分转换" class="headerlink" title="（三）、小数部分转换"></a>（三）、小数部分转换</h3><h4 id="1、十进制转二进制-1"><a href="#1、十进制转二进制-1" class="headerlink" title="1、十进制转二进制"></a>1、十进制转二进制</h4><ol>
<li>转换原理：十进制小数转换成二进制小数采用“乘2取整，顺序输出”法；</li>
</ol>
<p>例如：0.14D &rarr; 0.00100011B</p>
<div class="highlight-container" data-rel="Plaintext"><figure class="iseeu highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">0.14 * 2 = 0.28 ----0</span><br><span class="line">0.28 * 2 = 0.56 ----0</span><br><span class="line">0.56 * 2 = 1.12 ----1</span><br><span class="line">0.12 * 2 = 0.24 ----0</span><br><span class="line">0.24 * 2 = 0.48 ----0</span><br><span class="line">0.48 * 2 = 0.96 ----0</span><br><span class="line">0.96 * 2 = 1.92 ----1</span><br><span class="line">0.92 * 2 = 1.84 ----1</span><br><span class="line">......</span><br></pre></td></tr></table></figure></div>

<h4 id="2、十进制转八进制-1"><a href="#2、十进制转八进制-1" class="headerlink" title="2、十进制转八进制"></a>2、十进制转八进制</h4><ol>
<li>转换原理：十进制小数转换成八进制小数采用“乘8取整，顺序输出”法；</li>
</ol>
<p>例如：0.14D &rarr; 0.10753412Q</p>
<div class="highlight-container" data-rel="Plaintext"><figure class="iseeu highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">0.14 * 8 = 1.12 ----1</span><br><span class="line">0.12 * 8 = 0.96 ----0</span><br><span class="line">0.96 * 8 = 7.68 ----7</span><br><span class="line">0.68 * 8 = 5.44 ----5</span><br><span class="line">0.44 * 8 = 3.52 ----3</span><br><span class="line">0.52 * 8 = 4.16 ----4</span><br><span class="line">0.16 * 8 = 1.28 ----1</span><br><span class="line">0.26 * 8 = 2.08 ----2</span><br><span class="line">......</span><br></pre></td></tr></table></figure></div>

<h4 id="3、十进制转十六进制-1"><a href="#3、十进制转十六进制-1" class="headerlink" title="3、十进制转十六进制"></a>3、十进制转十六进制</h4><ol>
<li>转换原理：十进制小数转换成八进制小数采用“乘8取整，顺序输出”法；</li>
</ol>
<p>例如：0.14D &rarr; 0.23D70A3D</p>
<div class="highlight-container" data-rel="Plaintext"><figure class="iseeu highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">0.14 * 16 = 2.24 ----2</span><br><span class="line">0.24 * 16 = 3.84 ----3</span><br><span class="line">0.84 * 16 = 13.44 ----13</span><br><span class="line">0.44 * 16 = 7.04 ----7</span><br><span class="line">0.04 * 16 = 0.64 ----0</span><br><span class="line">0.64 * 16 = 10.24 ----10</span><br><span class="line">0.24 * 16 = 3.84 ----3</span><br><span class="line">0.84 * 16 = 13.44 ----13</span><br><span class="line">......</span><br></pre></td></tr></table></figure></div>

<h4 id="4、二进制、八进制、十六进制转十进制"><a href="#4、二进制、八进制、十六进制转十进制" class="headerlink" title="4、二进制、八进制、十六进制转十进制"></a>4、二进制、八进制、十六进制转十进制</h4><ol>
<li>原理：原理：按位乘以位权（小数点右侧从-1开始），总数相加；</li>
</ol>
<p>例如：</p>
<p>0.101B &rarr; 0.625D</p>
<div class="highlight-container" data-rel="Plaintext"><figure class="iseeu highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">1 * 2^(-1) + 0 + 1 * 2^(-3) = 0.5 + 0.125 = 0.625</span><br></pre></td></tr></table></figure></div>

<p>0.171Q &rarr; 0.236328125D</p>
<div class="highlight-container" data-rel="Plaintext"><figure class="iseeu highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">1 * 8^(-1) + 7 * 8^(-2) + 1 * 8^(-3) = 0.125 + 0.109375 + 0.001953125 = 0.236328125</span><br></pre></td></tr></table></figure></div>

<p>0.1AH &rarr; 0.1015625D</p>
<div class="highlight-container" data-rel="Plaintext"><figure class="iseeu highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">1 * 16^(-1) + 10 * 16^(-2) = 0.0625 + 0.0390625 = 0.1015625</span><br></pre></td></tr></table></figure></div>

<h2 id="二、码制"><a href="#二、码制" class="headerlink" title="二、码制"></a>二、码制</h2><p>在学习原码、反码、补码和移码之前，需要先了解<code>机器数</code>和<code>真值</code>的概念；</p>
<p><strong>机器数：</strong></p>
<p>一个数在计算机中的二进制表现形式，叫做这个数的机器数。机器数是带符号的，在计算机中用机器数的<code>最高位</code>存放符号，<br><strong>正数为0</strong>，<strong>负数为1</strong>；</p>
<p>比如：十进制中的数：+3，在计算机中标识为0000 0011；如果是-3：1000 0011；</p>
<p><strong>真值：</strong></p>
<p>因为第一位是符号位，所以机器数的形式就不等于真正的数值。<strong>为区别起见，将带符号位的机器数对应的真正数值称为机器数的真值。</strong></p>
<h3 id="（一）、原码"><a href="#（一）、原码" class="headerlink" title="（一）、原码"></a>（一）、原码</h3><p>原码就是符号位加上真值的绝对值，即用第一位表示符号位，其余位表示值。</p>
<p>第一位是符号位，不表示值，所以八位二进制的取值范围就是：[1111 1111, 0111 1111]即[-127, 127]。</p>
<p>例如：</p>
<p>1 的原码</p>
<div class="highlight-container" data-rel="Plaintext"><figure class="iseeu highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">原码：0000 0001</span><br></pre></td></tr></table></figure></div>

<p>-1 的原码</p>
<div class="highlight-container" data-rel="Plaintext"><figure class="iseeu highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">原码：1000 0001</span><br></pre></td></tr></table></figure></div>

<h3 id="（二）、反码"><a href="#（二）、反码" class="headerlink" title="（二）、反码"></a>（二）、反码</h3><ol>
<li>正数的反码是其本身；</li>
<li>附属的反码是在其原码的基础上，符号位不变，其余各位取反；</li>
</ol>
<p>例如：</p>
<p>1 的原码和反码</p>
<div class="highlight-container" data-rel="Plaintext"><figure class="iseeu highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">原码：0000 0001</span><br><span class="line">反码：0000 0001</span><br></pre></td></tr></table></figure></div>

<p>-1 的原码和反码</p>
<div class="highlight-container" data-rel="Plaintext"><figure class="iseeu highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">原码：1000 0001</span><br><span class="line">反码：1111 1110</span><br></pre></td></tr></table></figure></div>

<p>0.25 的</p>
<h3 id="（三）、补码"><a href="#（三）、补码" class="headerlink" title="（三）、补码"></a>（三）、补码</h3><ol>
<li>正数的补码就是其本身；</li>
<li>负数的补码是在其原码的基础上，符号位不变，其余各位取反，最后+1。(也即在反码的基础上+1)；</li>
</ol>
<p>例如：</p>
<p>2 的原码、反码和补码：</p>
<div class="highlight-container" data-rel="Plaintext"><figure class="iseeu highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">原码：0000 0011</span><br><span class="line">反码：0000 0011</span><br><span class="line">补码：0000 0011</span><br></pre></td></tr></table></figure></div>

<p>-2 的原码、反码和补码：</p>
<div class="highlight-container" data-rel="Plaintext"><figure class="iseeu highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">原码：1000 0011</span><br><span class="line">反码：1111 1100</span><br><span class="line">补码：1111 1101</span><br></pre></td></tr></table></figure></div>

<h3 id="（四）、移码"><a href="#（四）、移码" class="headerlink" title="（四）、移码"></a>（四）、移码</h3><p><strong>移码的定义：</strong></p>
<p>移码（又叫增码或偏置码）通常用于表示浮点数的阶码，其表示形式与补码相似，只是其<strong>符号位用“1”表示正数，用“0”表示负数</strong><br>，数值部分与补码相同。</p>
<p>$$[x]移 &#x3D; 2^n + x$$ $$( 2^n &gt; x &gt;&#x3D; -2^n )$$</p>
<p>其中：x为真值，n为真值的位数；</p>
<p>例如：</p>
<div class="highlight-container" data-rel="Plaintext"><figure class="iseeu highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">原码：1000 0001</span><br><span class="line">真值：-000 0001</span><br><span class="line">反码：1111 1110</span><br><span class="line">补码：1111 1111</span><br><span class="line">移码：x移= 2^7 - 0000 0001 = 1000 0000 - 0000 0001 = 0111 1111</span><br></pre></td></tr></table></figure></div>

<p><strong>移码与补码的关系：</strong></p>
<p>对一个数补码的符号位取反得到该数的移码；对一个数移码的符号位取反得到该数的补码；</p>
<h2 id="三、浮点数表示"><a href="#三、浮点数表示" class="headerlink" title="三、浮点数表示"></a>三、浮点数表示</h2><p>浮点数与定点数：</p>
<ul>
<li>浮点数：即小数点的位置不确定，可以在任何一个位置上；</li>
<li>定点数：即事先约定小数点的位置，将小数点位置固定；</li>
</ul>
<p>对于定点整数而言由于小数点固定，那么在字长一定的情况下就限制了可以表示数的范围和精度，所以就引出了浮点数据表示。</p>
<p><strong>浮点数表示法是指以适当的形式将比例因子表示在数据中，让小数点的位置根据需要而浮动。这样，在位数有限的情况下，<br>既扩大了数的表示范围，又保持了数的有效精度。</strong></p>
<p>阶码数值位数为m, 尾数数值部分位数为n</p>
<p>数的真值是：$$N &#x3D; r^E * M$$</p>
<p>r ：阶码的底，通常为2</p>
<p>E：阶码数值，决定数的范围</p>
<p>M：尾数，决定数的符号和精度</p>
<p>在这里可以用科学计数法来理解，比如：123456 &#x3D; 1.23456 * 10^5，r：10，E：5，M：1.23456</p>
<p><img  
                     lazyload
                     src="/images/loading.svg"
                     data-src="/images/data-representation-floating-point.png"
                      alt="data-representation-floating-point.png"
                ></p>
<h2 id="四、逻辑运算"><a href="#四、逻辑运算" class="headerlink" title="四、逻辑运算"></a>四、逻辑运算</h2><p>计算机中的逻辑运算又被成为“布尔运算”，分别是：<strong>与运算</strong>、<strong>或运算</strong>、<strong>非运算</strong>、<strong>异或运算</strong>；此外在门电路中还存在：<br><strong>同或运算</strong>、<strong>与非运算</strong>、<strong>或非运算</strong>；</p>
<h3 id="1、与运算（AND）"><a href="#1、与运算（AND）" class="headerlink" title="1、与运算（AND）"></a>1、与运算（AND）</h3><p><strong>运算规则：一一得一，其余为零</strong></p>
<table>
<thead>
<tr>
<th>操作数1</th>
<th>操作数2</th>
<th>运算结果</th>
</tr>
</thead>
<tbody><tr>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
</tbody></table>
<h3 id="2、或运算（OR）"><a href="#2、或运算（OR）" class="headerlink" title="2、或运算（OR）"></a>2、或运算（OR）</h3><p><strong>运算规则：零零得零，其余为一</strong></p>
<table>
<thead>
<tr>
<th>操作数1</th>
<th>操作数2</th>
<th>运算结果</th>
</tr>
</thead>
<tbody><tr>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
</tbody></table>
<h3 id="3、非运算（NOT）"><a href="#3、非运算（NOT）" class="headerlink" title="3、非运算（NOT）"></a>3、非运算（NOT）</h3><p><strong>运算规则：一得零，零得一</strong></p>
<table>
<thead>
<tr>
<th>操作数1</th>
<th>运算结果</th>
</tr>
</thead>
<tbody><tr>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
</tr>
</tbody></table>
<h3 id="4、异或运算（XOR）"><a href="#4、异或运算（XOR）" class="headerlink" title="4、异或运算（XOR）"></a>4、异或运算（XOR）</h3><p><strong>运算规则：相同为零，不同为一</strong></p>
<table>
<thead>
<tr>
<th>操作数1</th>
<th>操作数2</th>
<th>运算结果</th>
</tr>
</thead>
<tbody><tr>
<td>1</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
</tbody></table>
<h3 id="5、同或（XNOR）"><a href="#5、同或（XNOR）" class="headerlink" title="5、同或（XNOR）"></a>5、同或（XNOR）</h3><p><strong>运算规则：相同为一，不同为零</strong></p>
<table>
<thead>
<tr>
<th>操作数1</th>
<th>操作数2</th>
<th>运算结果</th>
</tr>
</thead>
<tbody><tr>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>1</td>
</tr>
</tbody></table>
<h3 id="6、与非（NAND）"><a href="#6、与非（NAND）" class="headerlink" title="6、与非（NAND）"></a>6、与非（NAND）</h3><p><strong>运算规则：一一得零，其余为一</strong></p>
<p><em>先进行逻辑与运算，在进行逻辑非运算。</em></p>
<table>
<thead>
<tr>
<th>操作数1</th>
<th>操作数2</th>
<th>运算结果</th>
</tr>
</thead>
<tbody><tr>
<td>1</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>1</td>
</tr>
</tbody></table>
<h3 id="7、或非"><a href="#7、或非" class="headerlink" title="7、或非"></a>7、或非</h3><p><strong>运算规则：零零得一，其余为零</strong></p>
<p><em>先进行逻辑或运算，在进行逻辑非运算。</em></p>
<table>
<thead>
<tr>
<th>操作数1</th>
<th>操作数2</th>
<th>运算结果</th>
</tr>
</thead>
<tbody><tr>
<td>1</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>1</td>
</tr>
</tbody></table>

        </div>

        
            <div class="post-copyright-info w-full my-8 px-2 sm:px-6 md:px-8">
                <div class="article-copyright-info-container">
    <ul>
        <li><strong>Title:</strong> 数据的表示</li>
        <li><strong>Author:</strong> liyuncong</li>
        <li><strong>Created at
                :</strong> 2024-01-03 23:59:18</li>
        
            <li>
                <strong>Updated at
                    :</strong> 2024-01-10 10:53:47
            </li>
        
        <li>
            <strong>Link:</strong> https://liyuncc.gitee.io/2024/01/03/data-representation/
        </li>
        <li>
            <strong>
                License:
            </strong>
            

            
                This work is licensed under <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a>.
            
        </li>
    </ul>
</div>

            </div>
        

        

        

        
            <div class="article-nav my-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
                
                    <div class="article-prev border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
                        <a class="prev"
                        rel="prev"
                        href="/2024/01/09/data-check-code/"
                        >
                            <span class="left arrow-icon flex justify-center items-center">
                                <i class="fa-solid fa-chevron-left"></i>
                            </span>
                            <span class="title flex justify-center items-center">
                                <span class="post-nav-title-item">数据校验码</span>
                                <span class="post-nav-item">Prev posts</span>
                            </span>
                        </a>
                    </div>
                
                
                    <div class="article-next border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
                        <a class="next"
                        rel="next"
                        href="/2024/01/03/AntDB%E5%8D%95%E6%9C%BA%E7%89%88centos7%E9%83%A8%E7%BD%B2%E6%96%87%E6%A1%A3/"
                        >
                            <span class="title flex justify-center items-center">
                                <span class="post-nav-title-item">AntDB单机版centos7部署文档</span>
                                <span class="post-nav-item">Next posts</span>
                            </span>
                            <span class="right arrow-icon flex justify-center items-center">
                                <i class="fa-solid fa-chevron-right"></i>
                            </span>
                        </a>
                    </div>
                
            </div>
        


        
            <div class="comment-container px-2 sm:px-6 md:px-8 pb-8">
                <div class="comments-container mt-10 w-full ">
    <div id="comment-anchor" class="w-full h-2.5"></div>
    <div class="comment-area-title w-full my-1.5 md:my-2.5 text-xl md:text-3xl font-bold">
        Comments
    </div>
    

        
            
    <div id="waline"></div>
    <script type="module" data-swup-reload-script>
      import { init } from '/js/libs/waline.mjs';

      function loadWaline() {
        init({
          el: '#waline',
          serverURL: 'https://example.example.com',
          lang: 'zh-CN',
          dark: 'body[class~="dark-mode"]',
          requiredMeta: ['nick', 'mail'],
          emoji: [],
          recaptchaV3Key: "wasd",
          
        });
      }

      if (typeof swup !== 'undefined') {
        loadWaline();
      } else {
        window.addEventListener('DOMContentLoaded', loadWaline);
      }
    </script>



        
    
</div>

            </div>
        
    </div>

    
        <div class="toc-content-container">
            <div class="post-toc-wrap">
    <div class="post-toc">
        <div class="toc-title">On this page</div>
        <div class="page-title">数据的表示</div>
        <ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%B8%80%E3%80%81%E8%BF%9B%E5%88%B6%E8%BD%AC%E6%8D%A2"><span class="nav-text">一、进制转换</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%EF%BC%88%E4%B8%80%EF%BC%89%E3%80%81%E8%BF%9B%E5%88%B6%E8%A1%A8%E7%A4%BA"><span class="nav-text">（一）、进制表示</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%EF%BC%88%E4%BA%8C%EF%BC%89%E3%80%81%E6%95%B4%E6%95%B0%E9%83%A8%E5%88%86%E8%BD%AC%E6%8D%A2"><span class="nav-text">（二）、整数部分转换</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%EF%BC%88%E4%B8%89%EF%BC%89%E3%80%81%E5%B0%8F%E6%95%B0%E9%83%A8%E5%88%86%E8%BD%AC%E6%8D%A2"><span class="nav-text">（三）、小数部分转换</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%BA%8C%E3%80%81%E7%A0%81%E5%88%B6"><span class="nav-text">二、码制</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%EF%BC%88%E4%B8%80%EF%BC%89%E3%80%81%E5%8E%9F%E7%A0%81"><span class="nav-text">（一）、原码</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%EF%BC%88%E4%BA%8C%EF%BC%89%E3%80%81%E5%8F%8D%E7%A0%81"><span class="nav-text">（二）、反码</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%EF%BC%88%E4%B8%89%EF%BC%89%E3%80%81%E8%A1%A5%E7%A0%81"><span class="nav-text">（三）、补码</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%EF%BC%88%E5%9B%9B%EF%BC%89%E3%80%81%E7%A7%BB%E7%A0%81"><span class="nav-text">（四）、移码</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%B8%89%E3%80%81%E6%B5%AE%E7%82%B9%E6%95%B0%E8%A1%A8%E7%A4%BA"><span class="nav-text">三、浮点数表示</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%9B%9B%E3%80%81%E9%80%BB%E8%BE%91%E8%BF%90%E7%AE%97"><span class="nav-text">四、逻辑运算</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1%E3%80%81%E4%B8%8E%E8%BF%90%E7%AE%97%EF%BC%88AND%EF%BC%89"><span class="nav-text">1、与运算（AND）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2%E3%80%81%E6%88%96%E8%BF%90%E7%AE%97%EF%BC%88OR%EF%BC%89"><span class="nav-text">2、或运算（OR）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3%E3%80%81%E9%9D%9E%E8%BF%90%E7%AE%97%EF%BC%88NOT%EF%BC%89"><span class="nav-text">3、非运算（NOT）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4%E3%80%81%E5%BC%82%E6%88%96%E8%BF%90%E7%AE%97%EF%BC%88XOR%EF%BC%89"><span class="nav-text">4、异或运算（XOR）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5%E3%80%81%E5%90%8C%E6%88%96%EF%BC%88XNOR%EF%BC%89"><span class="nav-text">5、同或（XNOR）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#6%E3%80%81%E4%B8%8E%E9%9D%9E%EF%BC%88NAND%EF%BC%89"><span class="nav-text">6、与非（NAND）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#7%E3%80%81%E6%88%96%E9%9D%9E"><span class="nav-text">7、或非</span></a></li></ol></li></ol>

    </div>
</div>
        </div>
    
</div>



                

            </div>

            

        </div>

        <div class="main-content-footer">
            <footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
    <div class="info-container py-3 text-center">
        
        <div class="text-center">
            &copy;
            
              <span>2022</span>
              -
            
            2024&nbsp;&nbsp;<i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i>&nbsp;&nbsp;<a href="/">liyuncong</a>
        </div>
        
            <script data-swup-reload-script src="https://cn.vercount.one/js"></script>
            <div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
                
                    <span id="busuanzi_container_site_uv" class="lg:!block">
                        <span class="text-sm">VISITOR COUNT</span>
                        <span id="busuanzi_value_site_uv"></span>
                    </span>
                
                
                    <span id="busuanzi_container_site_pv" class="lg:!block">
                        <span class="text-sm">TOTAL PAGE VIEWS</span>
                        <span id="busuanzi_value_site_pv"></span>
                    </span>
                
            </div>
        
        <div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
            <span class="lg:block text-sm">POWERED BY <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a></span>
            <span class="text-sm lg:block">THEME&nbsp;<a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.6.0</a></span>
        </div>
        
        
            <div>
                Blog up for <span class="odometer" id="runtime_days" ></span> days <span class="odometer" id="runtime_hours"></span> hrs <span class="odometer" id="runtime_minutes"></span> Min <span class="odometer" id="runtime_seconds"></span> Sec
            </div>
        
        
            <script data-swup-reload-script>
                try {
                    function odometer_init() {
                    const elements = document.querySelectorAll('.odometer');
                    elements.forEach(el => {
                        new Odometer({
                            el,
                            format: '( ddd).dd',
                            duration: 200
                        });
                    });
                    }
                    odometer_init();
                } catch (error) {}
            </script>
        
        
        
    </div>  
</footer>
        </div>
    </div>

    
        <div class="post-tools">
            <div class="post-tools-container">
    <ul class="article-tools-list">
        <!-- TOC aside toggle -->
        
            <li class="right-bottom-tools page-aside-toggle">
                <i class="fa-regular fa-outdent"></i>
            </li>
        

        <!-- go comment -->
        
            <li class="go-comment">
                <i class="fa-regular fa-comments"></i>
            </li>
        
    </ul>
</div>

        </div>
    

    <div class="right-side-tools-container">
        <div class="side-tools-container">
    <ul class="hidden-tools-list">
        <li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
            <i class="fa-regular fa-magnifying-glass-plus"></i>
        </li>

        <li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
            <i class="fa-regular fa-magnifying-glass-minus"></i>
        </li>

        <li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
            <i class="fa-regular fa-moon"></i>
        </li>

        <!-- rss -->
        

        

        <li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
            <i class="fa-regular fa-arrow-down"></i>
        </li>
    </ul>

    <ul class="visible-tools-list">
        <li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
            <i class="fa-regular fa-cog fa-spin"></i>
        </li>
        
            <li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
                <i class="arrow-up fas fa-arrow-up"></i>
                <span class="percent"></span>
            </li>
        
        
    </ul>
</div>

    </div>

    <div class="image-viewer-container">
    <img src="">
</div>


    

</main>


    
<script src="/js/libs/Swup.min.js"></script>

<script src="/js/libs/SwupSlideTheme.min.js"></script>

<script src="/js/libs/SwupScriptsPlugin.min.js"></script>

<script src="/js/libs/SwupProgressPlugin.min.js"></script>

<script src="/js/libs/SwupScrollPlugin.min.js"></script>

<script src="/js/libs/SwupPreloadPlugin.min.js"></script>

<script>
    const swup = new Swup({
        plugins: [
            new SwupScriptsPlugin({
                optin: true,
            }),
            new SwupProgressPlugin(),
            new SwupScrollPlugin({
                offset: 80,
            }),
            new SwupSlideTheme({
                mainElement: ".main-content-body",
            }),
            new SwupPreloadPlugin(),
        ],
        containers: ["#swup"],
    });
</script>







<script src="/js/tools/imageViewer.js" type="module"></script>

<script src="/js/utils.js" type="module"></script>

<script src="/js/main.js" type="module"></script>

<script src="/js/layouts/navbarShrink.js" type="module"></script>

<script src="/js/tools/scrollTopBottom.js" type="module"></script>

<script src="/js/tools/lightDarkSwitch.js" type="module"></script>

<script src="/js/layouts/categoryList.js" type="module"></script>





    
<script src="/js/tools/codeBlock.js" type="module"></script>




    
<script src="/js/layouts/lazyload.js" type="module"></script>




    
<script src="/js/tools/runtime.js"></script>

    
<script src="/js/libs/odometer.min.js"></script>

    
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">




  
<script src="/js/libs/Typed.min.js"></script>

  
<script src="/js/plugins/typed.js" type="module"></script>






    
<script src="/js/libs/minimasonry.min.js"></script>

    
<script src="/js/plugins/masonry.js" type="module"></script>





<div class="post-scripts" data-swup-reload-script>
    
        
<script src="/js/tools/tocToggle.js" type="module"></script>

<script src="/js/layouts/toc.js" type="module"></script>

<script src="/js/plugins/tabs.js" type="module"></script>

    
</div>


</body>
</html>
